package ipad.asia.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import ipad.asia.entity.Shop;
import java.util.List;

@Repository
public interface ShopDao extends JpaRepository<Shop,Long> {
    Shop findById(int id);
    List<Shop> findByNameLike(String name);
    Shop findByEnterpriseId(int id);
    Shop findByName(String name);

    @Modifying
    @Query("update Shop set enterpriseId=?1 where name=?2")
    void updateEnterpriseId(int enterpriseId,String name);
}
